package com.zmn.oms.third.shunfeng.service;

import com.zmn.oms.common.exception.OmsBaseException;
import com.zmn.oms.model.entity.work.OrderWorkLogChange;
import com.zmn.oms.third.shunfeng.api.SFOrderOuterDataDTO;
import com.zmn.oms.third.shunfeng.dto.SFRequestDTO;

/**
 * 顺丰安装渠道对接的接口定义类
 *
 * @author xiewenbing
 * @date  2020/12//09 17:00
 */
public interface ShunfengService {

    /**
     * 处理订单任务请求
     *
     * @param requestDTO
     * @throws OmsBaseException
     */
    void handleOrderTaskRequest(SFRequestDTO requestDTO) throws OmsBaseException;

    /**
     * 处理到货请求
     *
     * @param requestDTO
     * @throws OmsBaseException
     */
    void handleArrivalNoticeRequest(SFRequestDTO requestDTO) throws OmsBaseException;

    /**
     * 同步订单派单
     * @param orderWorkLogChange
     * @throws OmsBaseException
     */
    void syncOrderDistribute(OrderWorkLogChange orderWorkLogChange) throws OmsBaseException;

    /**
     * 同步订单预约时间
     * @param orderWorkLogChange
     * @throws OmsBaseException
     */
    void syncOrderDutytime(OrderWorkLogChange orderWorkLogChange) throws OmsBaseException;

    /**
     * 同步订单完成
     * @param orderWorkLogChange
     * @throws OmsBaseException
     */
    void syncOrderComplete(OrderWorkLogChange orderWorkLogChange) throws OmsBaseException;

    /**
     * 同步订单失败
     *
     * @param orderId
     * @param failedReason
     * @throws OmsBaseException
     */
    void syncOrderFailed(Long orderId, String failedReason, String imageUrl) throws OmsBaseException;

    /**
     * 保存订单完成的图片
     *
     * @param orderId
     * @param imageUrl
     * @throws OmsBaseException
     */
    void saveOrderCompleteImage(Long orderId, String imageUrl) throws OmsBaseException;

    /**
     * 读取订单扩展信息
     *
     * @param orderId
     * @return
     * @throws OmsBaseException
     */
    SFOrderOuterDataDTO getOrderOutData(Long orderId) throws OmsBaseException;

    /**
     * 验证是否可以订单完成
     *
     * @param orderId
     * @param workId
     * @throws OmsBaseException
     */
    void verifyCompleteOrder(Long orderId,Long workId) throws OmsBaseException;
}
